﻿using System;
using System.Collections.Generic;
using System.Web;
using DataAccess;
using System.Data;
/// <summary>
/// Summary description for SemesterBS
/// </summary>
public class SemesterBS 
{
    SemesterDAO St;
	public SemesterBS()
	{
        St = new SemesterDAO();
		//
		// TODO: Add constructor logic here
		//
	}
    public List<Semester> ShowSemester()
    {
        DataTable tbl = St.ShowSemester();
        List<Semester> list = new List<Semester>();
        foreach (DataRow row in tbl.Rows)
        {
            Semester SY = new Semester(int.Parse(row[0].ToString()), int.Parse(row[1].ToString()), row[2].ToString(), DateTime.Parse(row[3].ToString()), DateTime.Parse(row[4].ToString()));
            list.Add(SY);
        }
        return list;
    }
    public int CodeSemester(string namesemester)
    {
        int code = St.CodeSemester(namesemester);
        return code;
    }
}